I frequently get the error: "Failed to set Clipboard Contents" during a particular export. The error doesn't appear to prevent the export from succeeding. However, the error is presented in the form of an ack and therefore pauses the export process until I acknowledge it. Since my exports often take quite a while, I like to be able to do other things while I'm waiting but the nagging acknowledgements drive me crazy. Does anyone know of a way to squelch these messages?
|
Re: Failed to set Clipboard Contents 1. You copy something to your clipboard manually (e.g. some passage from an email). If you have a bad timing you will get this message telling you, that whatever the exporter just tried to copy to the clipboard failed and will be missing in your export. If your timing is even worse, then the exporter will paste the stuff from your clipboard (e.g. the passage from your email) right to your export without you even noticing. 2. I noticed that sometimes OLE objects will get "corrupt" in some way, that when trying to open or trying to copy its contents to the clipboard you will get errors. Usually those need to be replaced. It is also not assured that these OLE objects will be exported properly. So, in the end, this message tells you that there is probably something wrong with your export and you should not just remove it. I am not sure you even can remove it, since the message is generated from a DOORS internal perm and I am not sure you can surpress it by using noError() or setIgnoreExceptions_() (whatever that second perm is for? Insights anyone?). Maybe that helps, Regards Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Failed to set Clipboard Contents Mathias Mamsch - Wed Jan 05 09:06:02 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS That being said, I'm not entirely sure the OLE object is "corrupt" either. The image is still viewable within the DOORS environment and can be manually copy pasted out to an external program. I did find a work-around for this issue though which may be useful to anyone else who is experiencing a similar problem. The DOORS exporter uses "setRichClip" in order to copy the object (including any OLE component) to the clipboard. However, in my case the OLE image was the only element in the object so I substituted "setRichClip" with "oleCopy". Using the "oleIsObject" function, I could determine when to use "oleCopy" instead of "setRichClip" and was successful with no error message. I still don't know why setRichClip fails on certain OLE objects though. |
Re: Failed to set Clipboard Contents
In the attached demo dxl, I have used the two key commands that are
//DemoOleExportError.dxl
/*Script shows a bug in richTextWithOle command that occurs after
command setRichClip() exports large numbers of bits.
To use run this script on a project having a number of oles.
The script may process every module the first time thru but has been observed to
fail after export large amount of ole.
Larger the oles the faster the script reaches the point of giving an un-trappable error in command: richTextWithOle.
Note: probeRichAttr_ also fails if used inplace of richTextWithOle.
The exact behavior depends upon the PC script executes on and also the projects used.
Script uses some of commands that are use in the word export dxl script that gives error problems during export.
*/
Object o
pragma runLim, 0
Module m =current
Buffer textBuffer = create
Buffer bx=create
ClipboardLock cl
cl = create(2000)
int k=0,iK
real r=0.0
void run()
{ bx+="\n\n"fullName(m) ": "
for o in m do
{ if( oleIsObject( o) )
{ textBuffer = richTextWithOle o."Object Text"
iK=length (tempStringOf textBuffer )
r=r+realOf(iK)
bx+= k "id " o."Absolute Number" ", size" iK "; " iK "\n"
setRichClip(richText tempStringOf textBuffer );
k++
}
}
}
Item i
Project p=current
string analyopts[] = {"Project", "Current", "cancel"}
int mode =0
mode = query("Select mode", analyopts)
if (mode == 2)halt
if (mode == 0)
for i in p do
{ m=null
if((type i) == "Formal") m = read (fullName(i), false)
if(!null m)run()
}
if (mode == 1)if(!null m)run()
print "#oles=" k " Total Ole Character Length=" r "\n"
delete cl
print bx""
|